
cd ""

global gdp = "grgdppc" 
global xvar = "all_stdscore" 

************gini
use "data/country_year_score.dta", clear

merge 1:1 iso year using "data/country_year_gini.dta"
keep if _merge == 3
drop _merge

eststo clear


egen iso_num = group(iso)
gsort iso_num year
tsset iso_num year
eststo: xtscc gini $xvar $gdp i.year, fe 



**********Market Participation
use "data/country_year_score.dta", clear

merge 1:1 iso year using "data/country_year_marketparticipation.dta"
keep if _merge == 3
drop _merge

egen iso_num = group(iso)
tsset iso_num year
eststo: xtscc npishequity $xvar $gdp i.year, fe


****** market participation 
use "data/country_year_score.dta", clear

merge 1:1 iso year using "data/marketpart_jst.dta"
drop if _merge == 2
drop _merge

replace mptloans = 100*mptloans //percentage of gross domestic product
replace mpthh = 100*mpthh

egen iso_num = group(iso)
tsset iso_num year

eststo: xtscc mpthh $xvar $gdp i.year, fe 
eststo: xtscc mptloans $xvar $gdp i.year, fe 

esttab using "output.csv", star(* 0.10 ** 0.05 *** 0.01) replace se stats(N r2 r2_w r2_a) drop(*year)
